<?php
@session_start();
 echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';

/*
 *  A Part of snock project
 *   Author king-of-war
 * Last modified 2009-4-20
 *
 */

 $root_path='../';   //set the root path for this file

include_once $root_path.'admin/smarty_config.php';
include_once $root_path.'admin/class/error.class.php';
include_once $root_path.'admin/class/member.class.php';
$error=new Errmsg();

$user=new member($root_path);
 if(isset($_GET['id'])){
 	$id=$_GET['id'];
 	$pass= $user->member_read($id);
 	$name=$pass[0]->get_name();
 	$group=$pass[0]->get_group();
 }else{
 	$info='请选择要修改的管理员';
 	$error->error_chinese($info);
 	exit;

 }
/*
 *
 * check identify
 */
include_once $root_path.'admin/class/verify.class.php';
$a=new verify($root_path);
$a->identity_check(3);


 /*
  * $fun: 1 means add sort
  * $fun: 0 means update sort
  */
  if(isset($_POST['Submit'])){
$group=$_POST['group'];
$line=$user->member_add($id,$name,'',$group,'',0);
if($line){
	$info='更新成功';
	$error->error_chinese($info);
}else{
		$info='更新失败';
	$error->error_chinese($info);
}

}


$smarty->assign("name",$name);
$smarty->assign("right",$group);
 $smarty->display("admin_edit.html");
?>
